package Day12;

import java.util.HashSet;
import java.util.Iterator;

public class Demo05 {
    public static void main(String[] args) {
        HashSet<String> set = new HashSet<>();
        set.add("锄禾日当午");
        set.add("汗滴禾下土");
        set.add("谁知盘中餐");
        set.add("粒粒皆辛苦");
//        Iterator<String> iterator = set.iterator();
//        while(iterator.hasNext()){
//            System.out.println(iterator.next());
////            汗滴禾下土
////            谁知盘中餐
////            锄禾日当午
////            粒粒皆辛苦
//        }
        for (String s:set) {
            System.out.println(s);
            //汗滴禾下土
            //谁知盘中餐
            //锄禾日当午
            //粒粒皆辛苦
        }
    }
}
